<template>
	<view style="height: 100%">
		<!-- pages/skin2/index.wxml -->

		<view class="pageBox">
			<header-nav headerBg="#fff" temp="skin2" :searchHot="searchHot" :showBottom="true" module="siteConfig"
				:scanIcon="true" :needMessage="true" :pageHide="pageHideb" :show="true"></header-nav>

			<!-- 页面内容s -->
			<view :class="'pageContainer ' + grayscale">
				<view class="fixedBox fixedTop" :style="`padding-top:${headH}px;top:${navTop}px`" v-if="isTop">
					<view class="typeListBox">
						<view class="typeList fn-clear">
							<block v-for="(item, ind) in infoType" :key="ind">
								<view :class="'li type_item ' + (item.id == currInfoOn ? 'on_chose' : '')"
									@tap="changeType" data-init="1" :data-item="item">
									{{ item.typename }}
								</view>
							</block>
						</view>
						<view class="moreBtn" @tap="goLink" data-code="info" :data-web="`${masterDomain}/info`"
							data-url="/pages/packages/info/index/index" data-type="1" v-if="infoType.length>0">
							<image :src="imgPath + '/skin2/more_btn.png?v=' + imgVersion" mode="aspectFit">
							</image>
						</view>
					</view>
					<view class="typeDetailBox">
						<view class="left_type">
							<block v-for="(type, index) in infoType" :key="index">
								<view class="ulBox"
									v-if="type.id == currInfoOn && type.lowerList && type.lowerList.length"
									:data-search="type.searchall">
									<view class="ul">
										<view v-if="type.searchall == 0"
											:class="'span ' + (currLowerOn == '' ? 'active' : '')"
											@tap="changeLowerType" data-init="1" data-typeid="" data-style="0">
											全部
										</view>
										<view :data-style="typeDetail.style"
											:class="'span ' + (currLowerOn == typeDetail.id ? 'active' : '')"
											:data-typeid="typeDetail.id" :data-item="currTypeDetail"
											@tap="changeLowerType" data-init="1"
											v-for="(typeDetail, ind_low) in type.lowerList" :key="ind_low">
											{{ typeDetail.typename }}
										</view>
									</view>
								</view>
							</block>
						</view>
						<view class="right_shai" v-if="infoType.length>0">
							<view class="label"
								v-if="currTypeDetail.item && currTypeDetail.item.length > 0 && checkPop(currTypeDetail.item)"
								@tap="showPopFun" data-type="item">
								<view class="text">{{ checkPop(currTypeDetail.item).title }}</view>
								<view class="icon">
									<image :src="imgPath + '/skin2/arr_down.png?v=' + imgVersion" mode="aspectFit">
									</image>
								</view>
							</view>
							<view class="label" v-if="addrList && addrList.length > 0" @tap="showPopFun"
								data-type="address">
								<view class="text">{{ addrText ? addrText : '区域' }}</view>
								<view class="icon">
									<image :src="imgPath + '/skin2/arr_down.png?v=' + imgVersion" mode="aspectFit">
									</image>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 多图 广告位 s -->
				<view class="advSwiperBox relative" v-if="swiperItem.list.length > 0">
					<swiper :autoplay="swiperConfig.autoplay" :interval="swiperConfig.interval"
						:duration="swiperConfig.duration" :circular="true" indicator-color="rgba(255, 255, 255, .5)"
						indicator-active-color="#ffffff" @change="swiperChange">
						<block v-for="(item, index) in swiperItem.list" :key="index">
							<swiper-item>
								<view :class="'swiper-item ' + (index == swiperCurr ? 'currSwiper' : '')">
									<image :src="item.turl" mode="aspectFill" :data-type="item.urlType"
										:data-url="item.url" @tap="goLink" class="picAdv"></image>
									<image :src="`${imgStaticPath}/advMarkTouch.png?v=${imgVersion}`"
										:class="`advLabel _${item.advMarkPostion}_`"
										v-if="item.advMarkState==1&&item.markState==0"></image>
								</view>
							</swiper-item>
						</block>
					</swiper>
					<view class="pagination" v-if="swiperItem.list.length > 1">
						<block v-for="(item, index) in swiperItem.list" :key="index">
							<view :class="'pagination-bullets ' + (index == swiperCurr ? 'active' : '')"></view>
						</block>
					</view>
				</view>
				<!-- 多图  广告位 e -->

				<!-- 导航s -->
				<view class="swiper-container relative" v-if="moduleNav.length > 0">
					<swiper class="navSwiperBox" @change="swiperNavChange" style="height: 180rpx">
						<block v-for="(item, index) in moduleNav" :key="index">
							<swiper-item>
								<!-- 微信平台 -->
								<view class="navBox fn-clear" v-if="platForm=='mp-weixin'">
									<block v-for="(nav, idx) in item" :key="idx">
										<view class="nav" :data-url="nav.url" :data-id="nav.id" :data-type="nav.type"
											@tap="goLink">
											<view class="icon-circle">
												<image :src="nav.icon" mode="aspectFill" />
											</view>
											<view class="icon-txt">{{ nav.name }}</view>
										</view>
									</block>
								</view>
								<!-- 抖音平台 -->
								<view class="navBox fn-clear" v-else>
									<block v-for="(nav, idx) in item" :key="idx">
										<view class="nav" :data-url="nav.url" :data-id="nav.id" :data-type="nav.type"
											@tap="goLink" hover-class="none"
											v-if="nav.url.indexOf('dyMiniprogram://im/')==-1">
											<view class="icon-circle">
												<image :src="nav.icon" mode="aspectFill" />
											</view>
											<view class="icon-txt">{{ nav.name }}</view>
										</view>
										<!-- 客服按钮 -->
										<button class="nav" open-type="im"
											:data-im-id="nav.url.split('/')[nav.url.split('/').length-1]" v-else>
											<view class="icon-circle">
												<image :src="nav.icon" mode="aspectFill" />
											</view>
											<view class="icon-txt">{{ nav.name }}</view>
										</button>
									</block>
								</view>
							</swiper-item>
						</block>
					</swiper>
					<view class="pagination" v-if="moduleNav.length > 1">
						<!-- <view class="pageCurr" style="width:{{(swiperNavCurr+1) /moduleNav.length * 100}}%"></view> -->
						<block v-for="(item, index) in moduleNav" :key="index">
							<view :class="'pagination-bullets ' + (index == swiperNavCurr ? 'active' : '')"></view>
						</block>
					</view>
				</view>
				<!-- 导航e -->

				<!-- 签到广告 -->
				<view class="qiandaoAdv relative" v-if="indexAdv[2]">
					<view :data-url="userid?indexAdv[2].href:loginUrl" :data-type="userid?indexAdv[2].urlType:1"
						@tap="goLink">
						<image :src="indexAdv[2].turl" mode="aspectFill" class="picAdv" />
						<image :src="`${imgStaticPath}/advMarkTouch.png?v=${imgVersion}`"
							:class="`advLabel _${indexAdv[2].advMarkPostion}_`"
							v-if="indexAdv[2].advMarkState==1&&indexAdv[2].markState==0"></image>
					</view>
				</view>

				<view class="bgBox">
					<view class="bg_white"></view>
					<!-- 砍价/特价/拼团/抢购/ -->
					<view class="shopCon relative" v-if="moduleArr.shop && deadshop.length > 0">
						<view class="shopHead">
							<view class="h2">
								<text
									:style="currShopHDtype != '1' ? 'color:#EF2424;' : ''">{{ currShopHDTitle }}</text>
								<view class="textShow">
									<swiper v-if="kanSuccessList.length" class="searchSwipe search" interval="2000"
										:circular="true" :autoplay="true" :vertical="true">
										<block v-for="(item, index) in kanSuccessList" :key="index">
											<swiper-item @touchmove.stop.prevent="catchTouchMove">{{ item.nickname }}
												{{ item.enddate }}砍价成功</swiper-item>
										</block>
									</swiper>
									<view class="timeOff" v-if="currShopHDtype == '1' && timeStr">
										<text class="">{{ timeStr[1] }}</text>
										:
										<text class="">{{ timeStr[2] }}</text>
										:
										<text class="">{{ timeStr[3] }}</text>
									</view>
									<text v-else-if="shopSubtit">{{ shopSubtit }}</text>
								</view>
							</view>
							<view class="more_btn" :data-url="shopmoreUrl" @tap="goLink">
								更多
								<image :src="imgPath + '/skin2/more_shop.png?v=' + imgVersion" />
							</view>
						</view>
						<view class="proListBox">
							<swiper>
								<swiper-item class="proShow" item-id="" v-for="(item, index) in deadshop" :key="index">
									<view class="pro fn-clear" @tap="goLink" :data-url="pro.url"
										v-for="(pro, index1) in item" :key="index1">
										<view class="pro_img">
											<image :src="pro.litpic" mode="aspectFill" :lazy-load="true" @error=""
												@load=""></image>
											<view class="inverstory" v-if="pro.huodonginverstory <= 10">
												剩{{ pro.huodonginverstory }}件</view>
										</view>

										<view class="pro_info">
											<view class="pro_title h3">{{ pro.title }}</view>
											<view class="pro_limit p">{{ pro.limitText }}</view>
											<view class="pro_price">
												<view class="span currprice">
													{{ currency.symbol }}
													<text class="int">{{ pro.price_int }}</text>
													<text class="float"
														v-if="pro.price_float">{{ pro.price_float }}</text>
												</view>
												<text class="oprice">{{ currency.symbol }}{{ pro.mprice }}</text>
											</view>
										</view>
									</view>
								</swiper-item>
							</swiper>
						</view>
					</view>

					<!-- 广告位 -->
					<view class="advBox relative fn-clear" v-if="indexAdv[3] && indexAdv[3].list.length">
						<view class="advImg" :data-url="item.url" :data-type="item.urlType" @tap="goLink"
							v-for="(item, index) in indexAdv[3].list" :key="index">
							<image :src="item.turl" mode="aspectFill" class="picAdv"/>
							<image :src="`${imgStaticPath}/advMarkTouch.png?v=${imgVersion}`"
								:class="`advLabel _${item.advMarkPostion}_`"
								v-if="item.advMarkState==1&&item.markState==0"></image>
						</view>
					</view>

					<!-- 分类信息相关 -->
					<view class="infoContainer">
						<view class="fixedBox noTop">
							<view class="typeListBox">
								<view class="typeList fn-clear">
									<block v-for="(item, ind) in infoType" :key="ind">
										<view :class="'li type_item ' + (item.id == currInfoOn ? 'on_chose' : '')"
											@tap="changeType" :data-item="item">{{ item.typename }}</view>
									</block>
								</view>
								<view class="moreBtn" @tap="goLink" data-code="info" :data-web="`${masterDomain}/info`"
									data-url="/pages/packages/info/index/index" data-type="1" v-if="infoType.length>0">
									<image :src="imgPath + '/skin2/more_btn.png?v=' + imgVersion" mode="aspectFit">
									</image>
								</view>
							</view>
							<view class="typeDetailBox">
								<view class="left_type">
									<block v-for="(type, index) in infoType" :key="index">
										<view class="ulBox"
											v-if="type.id == currInfoOn && type.lowerList && type.lowerList.length"
											:data-search="type.searchall">
											<view class="ul">
												<view v-if="type.searchall == 0"
													:class="'span ' + (currLowerOn == '' ? 'active' : '')"
													@tap="changeLowerType" data-typeid="" data-style="0">
													全部
												</view>
												<view :data-style="typeDetail.style"
													:class="'span ' + (currLowerOn == typeDetail.id ? 'active' : '')"
													:data-typeid="typeDetail.id" :data-item="currTypeDetail"
													@tap="changeLowerType"
													v-for="(typeDetail, ind_low) in type.lowerList" :key="ind_low">
													{{ typeDetail.typename }}
												</view>
											</view>
										</view>
									</block>
								</view>
								<view class="right_shai" v-if="infoType.length>0">
									<view class="label"
										v-if="currTypeDetail.item && currTypeDetail.item.length > 0 && checkPop(currTypeDetail.item)"
										@tap="showPopFun" data-type="item">
										<view class="text">{{ checkPop(currTypeDetail.item).title }}</view>
										<view class="icon">
											<image :src="imgPath + '/skin2/arr_down.png?v=' + imgVersion"
												mode="aspectFit"></image>
										</view>
									</view>
									<view class="label" @tap="showPopFun" data-type="address"
										v-if="addrList && addrList.length > 0">
										<view class="text">{{ addrText ? addrText : '区域' }}</view>
										<view class="icon">
											<image :src="imgPath + '/skin2/arr_down.png?v=' + imgVersion"
												mode="aspectFit"></image>
										</view>
									</view>
								</view>
							</view>
						</view>

						<view class="infoListBox">
							<view class="ul">
								<block v-for="(info, info_index) in infoList" :key="info_index">
									<view :class="'li ' + (info.visited ? 'visited' : '') + ' li_' + info_index"
										v-if="!list_style" @tap="goVisit" :data-index="info_index" :data-item="info"
										data-code="info" :data-web="`${masterDomain}/info/detail/detail?id=${info.id}`"
										:data-url="'/pages/packages/info/detail/detail?id=' + info.id" data-type="1">
										<view class="isTop" v-if="info.isbid === '1'">
											<image :src="imgPath + '/skin2/isTop.png?v=' + imgVersion" mode="aspectFit">
											</image>
										</view>
										<view class="h2" v-if="!info.open">
											{{ info.titleStr }}
											<view class="more" v-if="info.titleNew.length > 55">
												...
												<text data-type="1" :data-index="info_index"
													@tap.stop.prevent="openContent"
													:data-currScrollTop="info.currScrollTop ? info.currScrollTop : 0">
													点击展开
												</text>
											</view>
										</view>
										<view class="h2 normal" v-else>
											<!-- <template is="wxParse" :data="wxParseData:info.bodys.nodes"/> -->
											<mp-html :content="info.body"></mp-html>
											<view class="more" v-if="info.titleNew.length > 55">
												<text data-type="" :data-index="info_index"
													:data-currScrollTop="info.currScrollTop ? info.currScrollTop : 0"
													@tap.stop.prevent="openContent">
													点击收起
												</text>
											</view>
										</view>
										<view class="infoDetail">
											<view class="pubdate">
												{{ info.pubdate4 }}
												<text class="infoTime">{{ info.valid }}</text>
											</view>
											<view class="infoother">
												<text class="infoRead">{{ info.click }}浏览</text>
												<view class="shoucang" @tap.stop.prevent="shoucang"
													:data-index="info_index" :data-id="info.id"
													:data-hasShou="info.collect">
													<view class="icon" v-if="!info.collect">
														<image :src="imgPath + '/info/sou_2.png?v=' + imgVersion"
															mode="aspectFill"></image>
													</view>
													<view class="icon" v-else>
														<image :src="imgPath + '/info/sou_1.png?v=' + imgVersion"
															mode="aspectFill"></image>
													</view>
													{{ info.collect != 1 ? '收藏' : '已收藏' }}
												</view>
											</view>
										</view>
										<view class="infoLabels">
											<block v-for="(lab, lInd) in info.feature4" :key="lInd">
												<view :class="'ilab ' + (lab.heightlight ? 'bold' : '')"
													v-if="lab.value">
													{{ lab.value }}
												</view>
											</block>
											<block v-for="(lab, lInd) in info.label" :key="lInd">
												<view class="ilab" v-if="lab.name">{{ lab.name }}</view>
											</block>
										</view>
										<view class="picsBox fn-clear">
											<view class="pic" v-if="info.videoPoster" data-index="0"
												@tap.stop.prevent="previewFn(info_index,0)">
												<view class="videoIcon">
													<image
														:src="masterDomain + '/static/images/siteSearch_touch/video_icon.png?v=' + imgVersion"
														mode="aspectFill"></image>
												</view>
												<image :src="info.videoPoster" mode="aspectFill" :lazy-load="true">
												</image>
											</view>
											<block v-for="(img, imgInd) in info.picArrs" :key="imgInd">
												<view class="pic" v-if="imgInd < (info.videoPoster ? 2 : 3)"
													@tap.stop.prevent="previewFn(info_index,imgInd + (info.videoPoster ? 1 : 0))"
													:data-index="imgInd + (info.videoPoster ? 1 : 0)">
													<view class="imgMask"
														v-if="info.picArrs.length > (info.videoPoster ? 2 : 3) && imgInd == (info.videoPoster ? 1 : 2)">
														+{{ info.picArrs.length - (info.videoPoster ? 2 : 3) }}
													</view>

													<image :src="img.litpic" mode="aspectFill" />
												</view>
											</block>
										</view>
										<view class="infoOpt">
											<view class="btnGroup">
												<block v-if="userid && !userPhoneCheck && privateNumber_state">
													<button class="btn_call btn" type="primary" data-module="info"
														data-temp="detail" :data-aid="info.id"
														@tap.stop.prevent="bindUserPhoneNumber" :data-index="info_index"
														:data-info="info">
														<image class="icon"
															:src="imgPath + '/skin2/tel_white.png?v=' + imgVersion" />
														打电话
													</button>
												</block>
												<block v-else>
													<view class="btn_call btn" @tap.stop.prevent="callPhone"
														:data-index="info_index" :data-info="info" data-module="info"
														data-temp="detail" :data-aid="info.id" :data-tel="info.tel">
														<image class="icon"
															:src="imgPath + '/skin2/tel_white.png?v=' + imgVersion" />
														打电话
													</view>
												</block>
												<button class="btn_share btn" open-type="share" :data-detail="info"
													type="default" @tap.stop.prevent="test">
													<view class="icon">
														<image :src="imgPath + '/skin2/share.png?v=' + imgVersion"
															mode="aspectFit"></image>
													</view>
													分享
												</button>
											</view>
											<view class="posi" v-if="info.addrArr">
												{{ info.addrArr }}
												<view class="icon">
													<image :src="imgPath + '/skin2/posi.png?v=' + imgVersion"
														mode="aspectFit"></image>
												</view>
											</view>
										</view>
									</view>

									<view
										:class="'li otherStyle ' + (info.visited ? 'visited' : '') + ' li_' + info_index"
										v-else @tap="goLink" :data-item="info" data-code="info"
										:data-web="`${masterDomain}/info/detail/detail?id=${info.id}`"
										:data-url="'/pages/packages/info/detail/detail?id=' + info.id" data-type="1">
										<view class="isTop" v-if="info.isbid === '1'">
											<image :src="imgPath + '/skin2/isTop.png?v=' + imgVersion"
												mode="aspectFit" />
										</view>
										<view class="memberInfo" v-if="info.member">
											<view class="mHead">
												<image :src="info.member.photo" mode="aspectFill"></image>
											</view>
											<view class="mDetail">
												<view class="h2">
													{{ info.member.nickname }}
													<text
														:class="'check ' + (info.member.certifyState == '1' ? 'hasCheck' : '')">
														{{ info.member.certifyState == '1' ? '已实名' : '未实名' }}
													</text>
												</view>
												<view class="p">
													<text class="ptext">{{ info.member.sex }}</text>
													<text class="line"
														v-if="info.member.age && info.member.sex">|</text>
													<text class="ptext"
														v-if="info.member.age">{{ info.member.age }}岁</text>
													<text class="line" v-if="info.member.nation">|</text>
													<text class="ptext">{{ info.member.nation }}</text>
												</view>
											</view>
										</view>
										<view class="infoLabels">
											<block v-for="(lab, lInd) in info.label" :key="lInd">
												<view class="ilab" v-if="lab.name">{{ lab.name }}</view>
											</block>
										</view>
										<view class="item_list">
											<view class="p" v-if="lab.value" v-for="(lab, index) in info.feature4"
												:key="index">
												<text class="label">{{ lab.title }}：</text>

												<text>{{ lab.value }}</text>
											</view>
										</view>
										<view class="con" v-if="!info.open">
											{{ info.titleStr }}
											<view class="more" v-if="info.titleNew.length > 55">
												...
												<text data-type="1" :data-index="info_index"
													@tap.stop.prevent="openContent"
													:data-currScrollTop="info.currScrollTop ? info.currScrollTop : 0">
													点击展开
												</text>
											</view>
										</view>
										<view class="con" v-else>
											<!-- <template is="wxParse" :data="wxParseData:info.bodys.nodes"/> -->
											<mp-html :content="info.body"></mp-html>
											<view class="more" v-if="info.titleNew.length > 55">
												<text data-type="" :data-index="info_index"
													:data-currScrollTop="info.currScrollTop ? info.currScrollTop : 0"
													@tap.stop.prevent="openContent">
													点击收起
												</text>
											</view>
										</view>
										<view class="picsBox fn-clear">
											<view class="pic" v-if="info.videoPoster" data-index="0"
												@tap.stop.prevent="previewFn(info_index,0)">
												<view class="videoIcon">
													<image
														:src="masterDomain + '/static/images/siteSearch_touch/video_icon.png?v=' + imgVersion"
														mode="aspectFill"></image>
												</view>
												<image :src="info.videoPoster" mode="aspectFill" :lazy-load="true">
												</image>
											</view>
											<block v-for="(img, imgInd) in info.picArrs" :key="imgInd">
												<view class="pic" v-if="imgInd < (info.videoPoster ? 2 : 3)"
													@tap.stop.prevent="previewFn(info_index,imgInd + (info.videoPoster ? 1 : 0))">
													<view class="imgMask"
														v-if="info.picArrs.length > (info.videoPoster ? 2 : 3) && imgInd == (info.videoPoster ? 1 : 2)">
														+{{ info.picArrs.length - (info.videoPoster ? 2 : 3) }}
													</view>

													<image :src="img.litpic" mode="aspectFill" />
												</view>
											</block>
										</view>
										<view class="infoOpt">
											<view class="btnGroup">
												<block v-if="userid && !userPhoneCheck && privateNumber_state">
													<button class="btn_call btn" type="primary" data-module="info"
														data-temp="detail" :data-aid="info.id"
														@tap.stop.prevent="bindUserPhoneNumber" :data-index="info_index"
														:data-info="info">
														<image class="icon"
															:src="imgPath + '/skin2/tel_white.png?v=' + imgVersion" />
														打电话
													</button>
												</block>
												<block v-else>
													<view class="btn_call btn" @tap.stop.prevent="callPhone"
														:data-index="info_index" :data-info="info" data-module="info"
														data-temp="detail" :data-aid="info.id" :data-tel="info.tel">
														<image class="icon"
															:src="imgPath + '/skin2/tel_white.png?v=' + imgVersion" />
														打电话
													</view>
												</block>
												<button class="btn_share btn" open-type="share" :data-detail="info"
													type="default" @tap.stop.prevent="test">
													<view class="icon">
														<image :src="imgPath + '/skin2/share.png?v=' + imgVersion"
															mode="aspectFit"></image>
													</view>
													分享
												</button>
											</view>
											<view class="infoother">
												<text class="infoRead">{{ info.click }}浏览</text>
												<view class="shoucang" @tap.stop.prevent="shoucang"
													:data-index="info_index" :data-id="info.id"
													:data-hasShou="info.collect">
													<view class="icon" v-if="!info.collect">
														<image :src="imgPath + '/info/sou_2.png?v=' + imgVersion"
															mode="aspectFill"></image>
													</view>
													<view class="icon" v-else>
														<image :src="imgPath + '/info/sou_1.png?v=' + imgVersion"
															mode="aspectFill"></image>
													</view>
													{{ info.collect != 1 ? '收藏' : '已收藏' }}
												</view>
											</view>
										</view>
										<view class="posi" v-if="info.addrArr">
											<view class="icon">
												<image :src="imgPath + '/skin2/posi.png?v=' + imgVersion"
													mode="aspectFit"></image>
											</view>
											{{ info.addrArr }}
										</view>
									</view>
								</block>
								<view class="loading" v-if="loading">
									<image
										:src="masterDomain + '/static/images/siteSearch_touch/loadIcon.png?v=' + imgVersion"
										mode="aspectFit"></image>
									<view class="text">加载中...</view>
								</view>
								<view class="nodata" v-if="noData">
									<image :src="imgPath + '/skin2/noData.png?v=' + imgVersion" mode="aspectFit">
									</image>
									<view class="text">暂无数据</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view :class="'popMask ' + (showPop ? 'show' : '')" @tap="hidePop"></view>
			<view :class="'pop ' + (showPop ? 'show' : '')">
				<view class="dl" v-if="currTypeDetail.item && currTypeDetail.item.length > 0 && popType == 'item'">
					<view class="dt">{{ checkPop(currTypeDetail.item).title }}</view>
					<view class="dd">
						<view class="ul fn-clear">
							<view :data-id="checkPop(currTypeDetail.item).id"
								:class="'li ' + (checkIndexOf(currItem, item) ? 'on_chose' : '')" @tap="choseItem"
								:data-item="item" v-for="(item, index) in checkPop(currTypeDetail.item).options"
								:key="index">
								{{ item }}
							</view>
						</view>
					</view>
				</view>
				<view class="dl" v-if="popType == 'address'">
					<view class="dt">位置</view>
					<view class="dd">
						<view class="ul fn-clear">
							<view :class="'li ' + (addrid == item.id ? 'on_chose' : '')" :data-addrText="item.title"
								:data-addrid="item.id" @tap="choseItem" v-for="(item, index) in addrList" :key="index">
								{{ item.title }}
							</view>
						</view>
					</view>
				</view>
				<view class="btnsGroup">
					<view class="reset_btn a" @tap="resetInfo">重置</view>
					<view class="confirm_btn a" @tap="confirm">确定</view>
				</view>
			</view>
			<!-- 支付弹窗 -->
			<paypop id="paypop" :wx:hidden="!payPhoneState" :showPayPop="showPayPop" :payInfo="payInfo"
				@paypopb="showPayPop=false" @keepToCall="keepToCall($event, { tagId: 'paypop' })" ref="pay"></paypop>
		</view>
		<!-- 隐私保护通话 -->

		<privatenumber :phoneData="phoneData" @showPrivateNumber="phoneData.showPrivateNumber=0"
			@showhasPayNumber="phoneData.showhasPayNumber=0" ref="privatenumber" @topay="directTopay"
			@haspay="keepToCall" :payInfo="payInfo"></privatenumber>
		<previewMedia :previewb="previewb" :staticSrc="staticSrc" :currentIndex="currentIndex"
			@previewClose="previewb=false"></previewMedia>
		<private_tip :privateShow="privateb"></private_tip>
	</view>
</template>
<script>
	import headerNav from '../../components/public_header/public_header';
	import paypop from '../../components/public_pay/public_pay';
	import myPosition from '../../utils/publicLocation.js';
	import previewMedia from '../../components/previewMedia/previewMedia.vue';
	// pages/skin2/index.js
	//获取应用实例
	const app = getApp();
	// var wxParse = require('../../wxParse/wxParse.js');
	var qianggou_interval = null;
	var _this;
	export default {
		components: {
			headerNav,
			paypop,
			previewMedia
		},
		data() {
			return {
				privateb: false,
				phoneData: {}, //打电话组件数据
				needReload: false, //是否需要重载
				currentIndex: -1, //预览图片的下标
				staticSrc: [], //预览地址
				previewb: false, //媒体预览开关
				pageHideb: false, //页面显隐
				imgStaticPath: app.globalData.imgStaticPath,
				cityInfo: {
					name: app.globalData.cityInfo.name ? app.globalData.cityInfo.name : '加载中',
					cityid: app.globalData.cityInfo.cityid
				},

				//定位城市
				scanIcon: true,

				//二维码按钮
				searchHot: [],

				masterDomain: app.globalData.masterDomain,

				//系统主域名
				navTop: app.globalData.navTop,

				//头部距离
				imgVersion: app.globalData.imgVersion,

				//图片版本号
				imgPath: app.globalData.imgPath,

				//图片目录
				swiperCurr: 0,

				//广告位当前显示
				swiperNavCurr: 0,

				//导航当前显示
				swiperItem: {
					list: []
				},

				//广告图
				indexAdv: {},

				//广告图(非幻灯)
				swiperConfig: {
					indicatorDots: true,
					autoplay: true,
					interval: 4000,
					duration: 200
				},

				//轮播图配置
				currency: {
					code: 'RMB',
					name: '人民币',
					rate: '1',
					short: '元',
					symbol: '￥'
				},

				kanSuccessList: [],

				//砍价成功列表
				infoType: [],

				//分类
				currInfoOn: 0,

				//当前所在的大分类（1-4）
				currLowerOn: 0,

				//当前所在二级类目
				currTypeDetail: {
					item: ''
				},

				addrList: [],

				//区域列表
				popType: 0,

				//弹窗类型
				showPop: false,

				//是否显示弹窗
				options1: [],

				//类别选择
				isload: false,

				//加载开关
				infoList: [],

				//列表
				infoPage: 1,

				//页码
				currpoSi: '',

				currItem: [],

				//弹窗筛选
				addrid: '',

				addrText: '',

				// 隐私通话
				userid: 0,

				privateNumber_state: 0,
				userPhoneCheck: 0,
				payInfo: {},

				//支付信息
				showPayPop: false,

				currentElementEvent: null,

				//当前点击号码的event
				currInd: 0,

				payPhoneState: app.globalData.appConfig.cfg_payPhoneState ? app.globalData.appConfig.cfg_payPhoneState : 0,

				//付费查看电话
				noData: false,

				list_style: 0,

				//当前样式
				isTop: false,

				//是否置顶
				scrollTop: 0,

				//点击收起/展开用
				currScrollTop: 0,

				grayscale: '',
				headH: '',
				loading: false,
				moduleNav: '',

				moduleArr: {
					shop: ''
				},

				moduleCount: '',
				busInfoTiebaClass: '',
				deadshop: '',
				shopSubtit: '',
				shopmoreUrl: '',
				currShopHDtype: '',
				currShopHDTitle: '',
				ErrAlert: '',
				timeStr: '',
				shareTitle: '',
				sharePic: '',
				ind: '',

				type: {
					id: '',
					lowerList: '',
					searchall: ''
				},

				typeDetail: {
					style: '',
					id: '',
					typename: ''
				},

				ind_low: '',

				nav: {
					url: '',
					id: '',
					type: '',
					icon: '',
					name: ''
				},

				pro: {
					url: '',
					litpic: '',
					huodonginverstory: 0,
					title: '',
					limitText: '',
					price_int: '',
					price_float: '',
					mprice: ''
				},

				currencyClone: {
					symbol: ''
				},

				info_index: 0,

				info: {
					visited: false,
					id: '',
					isbid: '',
					open: '',
					titleNew: [],
					currScrollTop: false,
					valid: '',
					click: '',
					collect: '',
					feature4: [],
					label: [],
					videoPoster: '',
					picArr: '',
					video: '',
					picArrs: [],
					tel: '',

					member: {
						photo: '',
						certifyState: '',
						sex: '',
						age: '',
						nation: ''
					}
				},


				lab: {
					heightlight: false,
					value: '',
					name: '',
					title: ''
				},

				lInd: '',
				imgInd: 0,

				img: {
					litpic: ''
				},
				// 兼容项
				platForm: '',
				loginUrl: '',
				iosMiniHide: false,
				cacheData: {}, //缓存数据
			};
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad(options) {
			_this = this;
			if (app.globalData.wxprivate == -1) {
				app.watchG('wxprivate', function(value) {
					_this.wxprivate = value;
					if (value) { //弹出弹窗
						_this.privateb = true;
					} else {
						_this.onload(options);
					}
				})
			} else {
				if (app.globalData.wxprivate) { //弹出弹窗
					_this.privateb = true;
				} else {
					_this.onload(options);
				}
			}
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady() {
			var appInterval = setInterval(function() {
				if (app.globalData.appConfig && app.globalData.appConfig.cfg_basehost) {
					//数据请求完成
					_this.userid = app.globalData.userid;
					_this.privateNumber_state = app.globalData.appConfig.cfg_privateNumber_state ? app
						.globalData.appConfig.cfg_privateNumber_state : 0;
					//是否开启隐私通话
					_this.payPhoneState = app.globalData.appConfig.cfg_payPhoneState ? app.globalData
						.appConfig.cfg_payPhoneState : 0;
					//是否开启付费查看电话
					_this.currency = app.globalData.appConfig.currency;
					clearInterval(appInterval);
				}
			});
			_this.getInfoConfig();
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow() {
			this.pageHideb = false;
			if (app.globalData.cityInfo.cityid != this.cityInfo.cityid || this.needReload) {
				app.reloadFn()
			}
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide() {
			this.pageHideb = true;
			clearInterval(qianggou_interval);
		},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload() {
			clearInterval(qianggou_interval);
		},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh() {
			app.reloadFn();
		},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom() {
			// return false;
			if (!_this.isload) {
				_this.getInfoList();
			}
		},
		/**
		 * 用户点击右上角分享
		 */
		onShareAppMessage(options) {

			if (app.globalData.cityInfo.name) {
				var cityname = app.globalData.cityInfo.name;
			} else {
				var cityname = '';
			}
			var title = app.globalData.appConfig.share.title;
			title = title.split('$city').join(cityname);
			if (app.globalData.userid) {
				var useridShare = '?fromShare=' + app.globalData.userid;
			} else {
				var useridShare = '';
			}
			return {
				title: title,
				path: '/pages/skin2/index?' + useridShare,
				// imageUrl: shareDetail.litpic ? shareDetail.litpic : _this.sharePic
			};
		},
		onShareTimeline() {
			return {
				imageUrl: app.globalData.siteConfig.sharePic ? app.globalData.siteConfig.sharePic : '',
				title: app.globalData.siteConfig.description ? app.globalData.siteConfig.description : app.globalData
					.appConfig.share.title,
			};
		},
		// 监听窗口滚动
		onPageScroll(e) {
			var scrollTop = e.scrollTop;
			// 获取头部高度，
			const query = uni.createSelectorQuery();
			query
				.select('.infoContainer')
				.boundingClientRect(function(rect) {
					if (rect.top <= _this.headH) {
						if (!_this.isTop) {
							_this.isTop = true
							_this.scrollTop = scrollTop
						}
					} else {
						if (_this.isTop) {
							_this.isTop = false
						}
					}
				})
				.exec();
		},
		methods: {
			onload(options) {
				app.cachePage('skin2', this);
				_this.loadData();
				_this.checkiOSMini()
				//页面标题
				_this.grayscale = app.globalData.appConfig.sitePageGray == '1' || app.globalData.appConfig.sitePageGray ==
					'2' ? 'grayscale' : '';
				// 平台切换
				this.platForm = app.globalData.platForm;
				let currPath = encodeURIComponent('/pages/skin2/index');
				if (app.globalData.loginMode == 0) { //原生
					_this.loginUrl = '/pages/login/index?wxMiniProgramLogin=1&back=1&path=' + currPath;
				} else { //H5
					_this.loginUrl = '/pages/redirect/index?url=' + encodeURIComponent(app.addUrlParam(app.globalData
						.masterDomain + '/login.html?from=wxmini&wxMiniProgramLogin=1&path=' + currPath,
						'forcelogout'));
				}
			},
			loadData() {
				// 加载字体
				var fontUrl = app.globalData.masterDomain + '/static/fonts/coregtd6.ttf';
				// app.getFonts('moneyNumber', fontUrl);
				myPosition.getPosition(function(data) {
					_this.currpoSi = data
				});
				uni.getStorage({
					key: 'cityInfo',
					success(res) {
						_this.cityInfo = res.data
					}
				});
				uni.showLoading({
					title: '加载中...'
				});
				_this.getAddrid();

				// 获取热搜词
				_this.getHotSearch();

				//广告位
				var cityInterval = setInterval(function() {
					uni.hideLoading();
					if (app.globalData.cityInfo && app.globalData.cityInfo.cityid) {
						clearInterval(cityInterval);

						// 导航加载完成后，加载模块数据
						_this.getModuleNav(function() {
							//限时抢购
							if (_this.moduleArr.shop) {
								_this.getDeadShop();
							}

							//分类信息分类
							if (_this.moduleArr.info) {
								_this.getInfoType();
							}
						});
						let adv = app.globalData.advName;
						_this.getAdvBanner(`首页_模板二_${adv}_广告一`, 1); //幻灯
						_this.getAdvBanner(`首页_模板二_${adv}_广告二`, 0, 2); //签到
						_this.getAdvBanner(`首页_模板二_${adv}_广告三`, 0, 3); //签到
					}
				}, 1000);
			},

			// 重置数据
			initData(type) {
				_this.currInfoOn = 0;
				//当前所在的大分类（1-4）
				// currLowerOn:0, //当前所在二级类目
				_this.currTypeDetail = '';
				_this.popType = 0;
				//弹窗类型
				_this.showPop = false;
				//是否显示弹窗
				_this.options1 = [];
				//类别选择
				_this.isload = false;
				//加载开关
				_this.infoPage = 1;
				//页码
				_this.addrid = '';
				_this.addrText = '';
				_this.payInfo = {};
				//支付信息
				_this.showPayPop = false;
				_this.currentElementEvent = null;
				//当前点击号码的event
				_this.currInd = 0;
				_this.loading = false;
				_this.noData = false;
				_this.isTop = false;
			},

			// 获取广告位
			getAdvBanner(title, type, index) {
				var dataPrarm = 'service=siteConfig&action=adv&model=siteConfig&cityid=' + app.globalData.cityInfo.cityid +
					'&title=' + title;
				var urlData = app.encodeUrl(dataPrarm);
				var advData = '';
				_this.$ajax.post({
					url: 'include/ajax.php?' + dataPrarm,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						advData = data.info;
						if (type) {
							var list = data.info.list;
							for (var i = 0; i < list.length; i++) {
								list[i].urlType = 0; //普通链接
								if (list[i].url.indexOf('wxMiniprogram://') > -1) {
									list[i].urlType = 2; //其他小程序
								} else if (list[i].url.indexOf('miniprogram://') > -1) {
									list[i].urlType = 1; //原生页面
								}
							}

							data.info.list = list;
							_this.swiperItem = data.info
							_this.cacheData['swiperItem'] = _this.swiperItem;
							uni.setStorageSync('skin2', _this.cacheData);
						} else {
							var indexAdv = _this.indexAdv;
							var data = data.info;

							//单图
							if (data.class == 1) {
								data.urlType = 0; //普通链接
								if (data.href.indexOf('wxMiniprogram://') > -1) {
									data.urlType = 2; //其他小程序
								} else if (data.href.indexOf('miniprogram://') > -1) {
									data.urlType = 1; //原生页面
								}

								//多图
							} else if (data.class == 2) {
								var list = data.list;
								for (var i = 0; i < list.length; i++) {
									list[i].urlType = 0; //普通链接
									if (list[i].url.indexOf('wxMiniprogram://') > -1) {
										list[i].urlType = 2; //其他小程序
									} else if (list[i].url.indexOf('miniprogram://') > -1) {
										list[i].urlType = 1; //原生页面
									}
								}

								data.list = list;
							}
							indexAdv[index] = data;
							// if(index == 3){
							//     console.log(data)
							// }
							_this.indexAdv = indexAdv
							_this.cacheData['indexAdv'] = _this.indexAdv;
							uni.setStorageSync('skin2', _this.cacheData);
						}
					} else {
						// wx.showToast({
						//   title:data.info,
						//   duration:1000000
						// })
					}
				})
			},

			// 轮播图切换
			swiperChange(e) {
				_this.swiperCurr = e.detail.current
			},

			// 导航切换
			swiperNavChange(e) {
				_this.swiperNavCurr = e.detail.current
			},

			// 列表跳转
			goVisit(e) {
				var currentTarget = e.currentTarget;
				var index = currentTarget.dataset.index;
				setTimeout(() => {
					_this.infoList[index].visited = true
				}, 500);
				_this.goLink(e);
			},

			// 跳转链接
			goLink(e) {
				var currentTarget = e.currentTarget;
				var url = currentTarget.dataset.url;
				if (!url) {
					return false;
				}
				if (currentTarget.dataset.code) {
					let code = currentTarget.dataset.code;
					let web = currentTarget.dataset.web;
					let newUrl = _this.urlProcess(code, web);
					if (newUrl.type == 'mini') {
						uni.navigateTo({
							url: url
						})
					} else {
						uni.navigateTo({
							url: '/pages/redirect/index?url=' + encodeURIComponent(web)
						})
					}
					return false
				}
				//原生页面
				if (currentTarget.dataset.type == 1) {
					url = url.replace('miniprogram://', '/');
					uni.navigateTo({
						url: app.addUrlParam(url)
					});
					//小程序类型
				} else if (currentTarget.dataset.type == 2) {
					var ahref = url.replace('wxMiniprogram://', '');
					var miniId = ahref.split('?/')[0];
					var //小程序原始id
						path = ahref.split('?/')[1]; //跳转的路径
					var _ghId = miniId.split('/')[0];
					var _appid = miniId.split('/')[1];
					var _path = path ? '/' + path : '';
					uni.navigateToMiniProgram({
						appId: _appid,
						path: _path,
						success(res) {
							// wx.navigateBack();
						},
						fail(res) {
							uni.showToast({
								title: res,
								icon: 'success',
								duration: 2000
							});
						}
					});

					//H5链接
				} else {
					if (url.indexOf('work.weixin.qq.com/kfid') > -1) {
						//小程序跳转客服
						var link = url.split('?id=')[0];
						var //客服链接
							id = url.split('?id=')[1]; //企业ID
						var path = '/pages/openkf/openkf?url=' + encodeURIComponent(link) + '&id=' + id;
						if (link && id) {
							uni.openCustomerServiceChat({
								extInfo: {
									url: link
								},
								corpId: id,
								success(res) {
									console.log(res);
								}
							});
						} else {
							uni.navigateTo({
								url: '/pages/redirect/index?url=' + encodeURIComponent(app.addUrlParam(
									url))
							});
						}
					} else {
						uni.navigateTo({
							url: '/pages/redirect/index?url=' + encodeURIComponent(app.addUrlParam(url))
						});
					}
				}
			},

			// 拨打电话
			callPhone(e) {
				var phone = e.currentTarget.dataset.tel;
				//判断是否登录
				var userid = app.globalData.userid;
				if (userid == null || userid == '') {
					this.needReload = true;
					app.tologin('/pages/goback');
					return false;
				}
				var info = e.currentTarget.dataset.info;
				if (info.payPhoneState || !app.globalData.appConfig.cfg_payPhoneState) {
					//已经支付过/不要用付费
					uni.showLoading({
						title: '获取中...'
					});
					app.callPhone(this, phone, e.currentTarget.dataset);
					_this.currentElementEvent = null;
					_this.currInd = 0;
				} else {
					if (this.iosMiniHide) { //需要支付并且在ios小程序中
						this.showiOSPayMsg();
						return false
					}
					uni.showLoading({
						title: '获取中...'
					});
					_this.currentElementEvent = e;
					_this.currInd = e.currentTarget.dataset.index;
					_this.getPhonePayAmount(e);
				}
			},

			// 支付完成 ，继续拨打
			keepToCall(data, _dataset) {
				if (data && data.fromAdv && data.fromAdv == 1) {} else {
					_this.infoList[_this.currInd].payPhoneState = 1
					_this.infoList[_this.currInd].tel = data.detail.phone || data.detail.info;
				}
				uni.showLoading({
					title: '获取中...'
				});
				app.callPhone(_this, data.detail, _this.currentElementEvent.currentTarget.dataset);
			},

			// 新增 激励选择付费/广告中 直接支付 
			directTopay() {
				_this.showPayPop = true;
				var el = _this.$refs.pay;
				el.payCutDown(_this.payInfo, _this.payInfo.timeout);
			},

			// 获取付费金额
			getPhonePayAmount(e) {
				var module = e.currentTarget.dataset.module;
				var temp = e.currentTarget.dataset.temp;
				var aid = e.currentTarget.dataset.aid;
				var dataPrarm = 'service=siteConfig&action=payPhoneDeal&aid=' + aid + '&temp=' + temp + '&module=' +
					module;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					uni.hideLoading();
					if (data.state == 100) {
						_this.payInfo = data.info
						if (app.globalData.appConfig && app.globalData.appConfig.cfg_payPhone && ((_this
								.platForm == 'mp-weixin' && app.globalData.appConfig.cfg_payPhone.wxmini) || (
								_this.platForm == 'web' && app.globalData.appBoolean && window.Android && app
								.globalData.appConfig.cfg_payPhone.tencentGDP_app_id && app.globalData
								.appConfig.cfg_payPhone.tencentGDP_placement_id))) {
							_this.$refs.privatenumber.showRewardPop = true;
						} else {
							_this.directTopay()
						}
					}
				})
			},

			// 获取用户手机号
			bindUserPhoneNumber: function(data) {
				let uCenter = app.globalData.appConfig.cfg_user_index;
				uni.navigateTo({
					url: '/pages/redirect/index?url=' + uCenter + '/security-chphone.html'
				})
				// app.bindUserPhoneNumber(this, data, function() {
				// 	var infoDetail = data.currentTarget.dataset.info;
				// 	_this.currentElementEvent = data;
				// 	_this.currInd = data.currentTarget.dataset.index;
				// 	_this.callPhone(data);
				// });
			},

			useOtherPhoneNumber: function(data) {
				app.useOtherPhoneNumber(this, data);
			},

			// 获取热搜词
			getHotSearch() {
				var dataPrarm = 'service=siteConfig&action=hotkeywords&module=index';
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						_this.searchHot = data.info
					} else {
						_this.searchHot = []
					}
				})
			},

			// 获取模块导航
			getModuleNav(func) {
				var dataPrarm = 'service=siteConfig&action=siteModule&type=1';
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var list = data.info;
						var moduleArr = {};
						var busInfoTiebaCount = 1;
						for (var i = 0; i < list.length; i++) {
							if (list[i].code) {
								moduleArr[list[i].code] = list[i];
								if (list[i].code == 'info') {
									busInfoTiebaCount++;
								}
								if (list[i].code == 'tieba') {
									busInfoTiebaCount++;
								}
							}
							var url = list[i].url;
							var type = 0;
							let code = list[i].code; //模块名称
							let newUrl = _this.urlProcess(code, url);
							if (newUrl.type == 'mini') {
								url = `/pages/packages/${code}/index/index`; //模块首页
								type = 1;
							}

							//小程序类型
							if (list[i].url.indexOf('wxMiniprogram://') > -1) {
								type = 2;
							}
							list[i] = {
								name: list[i].name,
								icon: list[i].icon,
								url: url,
								type: type
							};
						}
						var navList = [];
						for (i = 0, len = list.length, void 0; i < len; i += 5) {
							var i;
							var len;
							navList.push(list.slice(i, i + 5));
						}
						busInfoTiebaCount = moduleArr['business'] ? busInfoTiebaCount : busInfoTiebaCount -
							1;
						_this.moduleNav = navList
						_this.moduleArr = moduleArr
						_this.moduleCount = list.length
						_this.busInfoTiebaClass = busInfoTiebaCount == 3 ? 'smallLi' :
							busInfoTiebaCount == 2 ? 'middleLi' : ''
						func(); //加载模块数据
					} else {
						_this.moduleNav = []
						_this.moduleArr = []
						_this.moduleCount = 0
						_this.busInfoTiebaClass = ''
						func(); //加载模块数据
					}
					_this.cacheData['moduleNav'] = _this.moduleNav;
					_this.cacheData['moduleArr'] = _this.moduleArr;
					uni.setStorageSync('skin2', _this.cacheData);
				})
			},
			// 导航原生页面判断
			urlProcess(code, url) { //一个是原生页面code，一个是h5链接
				let config = app.globalData.appConfig;
				let arrModule = [];
				if (_this.platForm == 'mp-weixin') {
					arrModule = config.wxmini_native_module;
				} else if (_this.platForm == 'mp-toutiao') {
					arrModule = config.dymini_native_module;
				}
				let bool = arrModule.includes(code);
				if (bool) {
					return {
						type: 'mini',
						value: code
					} //使用原生
				} else {
					return {
						type: 'web',
						value: url
					} //使用h5
				}
			},
			// 商城相关商品
			getDeadShop() {
				var dataPrarm = 'service=shop&action=huodongOpen&pagetype=' + app.globalData.appConfig.shop_pagetype;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var huodongList = data.info.list;
						var moreUrl = '';
						var list = [];
						var deadshop = [];
						var priceName = 'huodongprice';
						var huodongtype = '3';
						var desc = '';
						var huodongtitle = '砍价狂欢';
						if (huodongList['3'] && huodongList['3'].length > 0) {
							// 砍价
							moreUrl = _this.moduleArr.shop.url + '/bargain_list.html';
							list = huodongList['3'];
							priceName = 'floorprice';
							huodongtype = '3';
							_this.getkanSuccessList(); //获取成功砍价的列表
						} else if (huodongList['2'] && huodongList['2'].length > 0) {
							// 特价秒杀
							moreUrl = _this.moduleArr.shop.url + '/secKill.html';
							list = huodongList['2'];
							huodongtype = '2'; //活动类型
							desc = '超值特惠，惊喜直降';
							huodongtitle = '特价秒杀';
						} else if (huodongList['5'] && huodongList['5'].length > 0) {
							// 拼图特惠
							moreUrl = _this.moduleArr.shop.url + '/pintuan.html';
							list = huodongList['5'];
							huodongtype = '5'; //活动类型
							desc = '参与拼单，立即拼成';
							huodongtitle = '拼团特惠';
						} else if (huodongList['1'] && huodongList['1'].length > 0) {
							moreUrl = _this.moduleArr.shop.url + '/search_list.html';
							list = huodongList['1'][0];
							huodongtype = '1'; //活动类型
							huodongtitle = '限时抢购';
						}
						if (huodongtype != '1') {
							for (var i = 0; i < list.length; i++) {
								var limitText = '';
								if (huodongtype == '3') {
									limitText = '可砍至';
								} else if (huodongtype == '2') {
									limitText = parseInt((list[i]['huodongprice'] / (list[i]['price'] ?
										list[i]['price'] : list[i]['mprice'])) * 10) + '折秒杀';
								} else if (huodongtype == '5') {
									limitText = list[i].huodongnumber + '人团';
								} else {
									limitText = '直降' + parseInt((list[i]['price'] ? list[i]['price'] :
										list[i]['mprice']) - list[i]['huodongprice']);
								}
								var price = parseFloat(Number(list[i][priceName]).toFixed(2)).toString();
								deadshop[i] = {
									url: list[i].url,
									litpic: app.changeFileSize(list[i].litpic, 240, 240),
									price_int: price.split('.')[0],
									price_float: price.split('.').length > 1 ? '.' + price.split('.')[
										1] : '',
									title: list[i].title,
									mprice: parseFloat(list[i].mprice),
									huodonginverstory: list[i].huodonginventory,
									limitText: limitText
								};
							}
							var listArr = [];
							for (i = 0, len = deadshop.length, void 0; i < len; i += 2) {
								var i;
								var len;
								listArr.push(deadshop.slice(i, i + 2));
							}
							_this.deadshop = listArr;
							_this.shopSubtit = desc;
							_this.shopmoreUrl = moreUrl;
							_this.currShopHDtype = huodongtype;
							//活动类型
							_this.currShopHDTitle = huodongtitle; //活动标题
						} else {
							_this.shopSubtit = '';
							_this.shopmoreUrl = moreUrl;
							_this.currShopHDtype = huodongtype;
							//活动类型
							_this.currShopHDTitle = huodongtitle; //活动标题

							_this.gettime();
						}
					} else {
						_this.deadshop = []
					}
					_this.cacheData['deadshop'] = _this.deadshop;
					uni.setStorageSync('skin2', _this.cacheData);
				})
			},

			// 获取成功砍价的列表
			getkanSuccessList() {
				var dataPrarm = 'service=shop&action=kanSuccessList';
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						_this.kanSuccessList = data.info
					}
					_this.cacheData['kanSuccessList'] = _this.kanSuccessList;
					uni.setStorageSync('skin2', _this.cacheData);
				})
			},

			// 获取分类信息的类型
			getInfoType(id, ind) {
				var dataPrarm = 'service=info&action=type&type=' + id;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var l_num = id ? data.info.length : 4;
						var infoArr = [];
						var len = data.info.length <= l_num ? data.info.length : l_num;
						for (let m = 0; m < len; m++) {
							infoArr.push(data.info[m]);
							if (id == undefined) {
								_this.getInfoType(data.info[m].id, m);
							}
						}
						if (id) {
							if (_this.currLowerOn == 0 && _this.infoType[0].id == id) {
								_this.currLowerOn = _this.infoType[0].searchall == 1 ? infoArr[0].id :
									'';
								_this.infoType[ind].lowerList = infoArr
							} else {
								_this.infoType[ind].lowerList = infoArr
							}
							if (!_this.currTypeDetail && ind == 0 && _this.infoType[0].searchall != 0) {
								//首次加载)
								_this.getTypeDetail(data.info[0].id, data.info[0].style);
							}
							if (ind == 0 && _this.infoType[0].searchall == 0) {
								_this.getInfoList();
							}
						} else {
							if (_this.currInfoOn == 0) {
								_this.currInfoOn = infoArr[0].id
								_this.currLowerOn = infoArr[0].searchall == 0 ? '' : 0
								_this.infoType = infoArr
							} else {
								_this.infoType = infoArr
							}
						}
						_this.cacheData['infoType'] = _this.infoType;
						uni.setStorageSync('skin2', _this.cacheData);
					}
				})
			},

			// 获取分类详情
			getTypeDetail(id, style) {
				var dataPrarm = 'service=info&action=typeDetail&id=' + id;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var detail = data.info[0];
						detail.style = style;
						_this.infoPage = 1;
						_this.isload = false;
						_this.currTypeDetail = detail;
						_this.currItem = [];
						_this.getInfoList();
					}
				})
			},

			// 改变分类
			changeType(e) {
				var itemCurr = e.currentTarget.dataset.item;
				var type = e.currentTarget.dataset.init;
				if (type && type == 1) {
					uni.pageScrollTo({
						scrollTop: _this.scrollTop,
						//滚动到页面节点的上边界坐标
						duration: 300 // 滚动动画的时长
					});
				}

				if (_this.currInfoOn != itemCurr.id) {
					_this.infoPage = 1;
					_this.isload = false;
					_this.currItem = [];
					// list_style:0,
					_this.currTypeDetail = '';
					// infoList:[],//清空数据
					_this.currInfoOn = itemCurr.id;
					_this.currLowerOn = itemCurr.searchall == 0 ? '' : itemCurr.lowerList[0].id;
					if (itemCurr.searchall != 0) {
						_this.getTypeDetail(itemCurr.lowerList[0].id, itemCurr.lowerList[0].style);
					} else {
						_this.getInfoList();
					}
				}
			},

			// 改变子分类
			changeLowerType(e) {
				var itemCurr = e.currentTarget.dataset.item; //当前所选
				var typeid = e.currentTarget.dataset.typeid;
				var style = e.currentTarget.dataset.style;
				var type = e.currentTarget.dataset.init;
				if (type && type == 1) {
					uni.pageScrollTo({
						scrollTop: _this.scrollTop,
						//滚动到页面节点的上边界坐标
						duration: 300 // 滚动动画的时长
					});
				}

				if (itemCurr && typeid != itemCurr.id) {
					_this.currLowerOn = typeid;
					_this.currTypeDetail = '';
					_this.infoPage = 1;
					_this.isload = false;
					_this.currItem = [];
					if (!typeid) {
						typeid = _this.currInfoOn;
						_this.getInfoList();
					} else {
						_this.getTypeDetail(typeid, style);
					}
				} else if (typeid == '') {
					if (!typeid) {
						typeid = _this.currInfoOn;
						_this.currLowerOn = '';
						_this.infoPage = 1;
						_this.isload = false;
						_this.getInfoList();
					}
				} else {
					_this.currLowerOn = typeid;
					_this.infoPage = 1;
					_this.isload = false;
					_this.currItem = [];
					_this.getTypeDetail(typeid, style);
				}
			},

			// 显示弹窗
			showPopFun(e) {
				var type = e.currentTarget.dataset.type;
				_this.showPop = true;
				_this.popType = type
			},

			// 获取数据
			getInfoList() {
				if (_this.isload) {
					return false;
				}
				_this.isload = true;
				_this.loading = true;
				_this.noData = false;
				var page = _this.infoPage;
				var isload = _this.isload;
				var infoList = _this.infoList;
				var typeid = _this.currLowerOn ? _this.currLowerOn : _this.currInfoOn;
				var itemStr = _this.currItem.length && _this.itemStr ? '&item=' + JSON.stringify(_this.itemStr) : '';
				var addridStr = _this.addrid ? '&addrid=' + _this.addrid : '';
				var dataPrarm = 'service=info&action=ilist_v2&page=' + page + '&pageSize=20' + itemStr + addridStr +
					'&typeid=' + typeid;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					isload = false;
					if (data.state == 100) {
						var list = data.info.list && data.info.list.length ? data.info.list : [];
						if (page == 1) {
							infoList = [];
						}
						for (var i = 0; i < list.length; i++) {
							var info = list[i];
							var title = info.titleNew;
							if (info.titleNew.length >= 55) {
								title = title.substring(0, 55);
							}
							var picArr = info.picArr;
							var changePicArr = [];
							if (picArr.length > 0) {
								changePicArr = picArr.map(function(item) {
									return {
										litpic: app.changeFileSize(item.litpic, 420,
											316)
									};
								});
							}
							info['titleStr'] = title;
							info['pubdate4'] = _this.returnHumanTime(info.pubdate, 2);
							info['picArrs'] = changePicArr;
							info['bodys'] = _this.detailBody;
							infoList.push(info);
						}
						page = page + 1;
						if (data.info.pageInfo.totalPage <= page) {
							isload = true;
						}
						_this.isload = isload;
						_this.infoPage = page;
						_this.infoList = infoList;
						_this.userPhoneCheck = infoList[0].userPhoneCheck;
						_this.loading = false;
						_this.list_style = _this.currLowerOn ? _this.currTypeDetail.style : 0;
					} else {
						_this.isload = true;
						_this.noData = true;
						_this.loading = false;
						_this.infoList = [];
					}
					_this.cacheData['infoList'] = _this.infoList;
					uni.setStorageSync('skin2', _this.cacheData);
				})
			},

			// 改变时间
			returnHumanTime(t, type) {
				var n = new Date().getTime() / 1000;
				var c = n - t;
				var str = '';
				if (c < 60) {
					str = '刚刚';
				} else if (c < 3600) {
					str = parseInt(c / 60) + '分钟前';
				} else if (c < 86400) {
					str = parseInt(c / 3600) + '小时前';
				} else if (c < 604800) {
					str = parseInt(c / 86400) + '天前';
				} else {
					str = _this.transTimes(t, type);
				}
				return str;
			},

			transTimes: function(timestamp, n) {
				const dateFormatter = app.dateFormatter(timestamp);
				const year = dateFormatter.year;
				const month = dateFormatter.month;
				const day = dateFormatter.day;
				const hour = dateFormatter.hour;
				const minute = dateFormatter.minute;
				const second = dateFormatter.second;
				if (n == 1) {
					return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
				} else if (n == 2) {
					return year + '-' + month + '-' + day;
				} else if (n == 3) {
					return month + '-' + day;
				} else {
					return 0;
				}
			},

			// 选择
			choseItem: function(e) {
				if (_this.popType == 'item') {
					var item = e.currentTarget.dataset.item;
					var id = e.currentTarget.dataset.id;
					var currItem = _this.currItem;
					if (currItem.indexOf(item) <= -1) {
						currItem.push(item);
					} else {
						currItem.splice(currItem.indexOf(item), 1);
					}
					var itemStr = [{
						id: id,
						value: currItem.join(',')
					}];
					_this.itemStr = itemStr;
					_this.currItem = currItem;
				} else {
					var addrid = e.currentTarget.dataset.addrid;
					var addrText = e.currentTarget.dataset.addrtext;
					if (_this.addrid != addrid) {
						_this.addrid = addrid
						_this.addrText = addrText
					}
				}
			},

			// 确定
			confirm(e) {
				_this.infoPage = 1;
				_this.isload = false;
				_this.showPop = false;
				_this.getInfoList();
			},

			// 重置
			resetInfo() {
				if (_this.popType == 'item') {
					_this.currItem = []
				} else {
					_this.addrid = ''
					_this.addrText = ''
				}
			},

			// 获取区域id
			getAddrid() {
				var dataPrarm = 'service=info&action=addr&type=' + app.globalData.cityInfo.cityid;
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						_this.addrList = data.info
					} else {
						_this.addrList = []
					}
				})
			},

			// 隐藏弹窗
			hidePop() {
				_this.showPop = false
				_this.resetInfo();
			},

			// 收藏
			shoucang(e) {
				var userid = app.globalData.userid;
				var collect = e.currentTarget.dataset.hasshou;
				var index = e.currentTarget.dataset.index;
				var id = e.currentTarget.dataset.id;
				if (userid == null || userid == '') {
					app.tologin();
					return false;
				}
				var type = collect ? 'del' : 'add';
				var url = 'service=member&action=collect&module=info&temp=detail&id=' + id + '&type=' + type;
				var urlData = app.encodeUrl(url);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var collect_state = type == 'del' ? 0 : 1;
						if (type == 'del') {
							_this.ErrAlert = '已取消收藏';
						} else {
							_this.ErrAlert = '收藏成功';
						}
						_this.infoList[index].collect = collect_state;
						_this.infoList[index].collectnum = _this.infoList[index].collectnum *
							1 + (type == 'del' ? -1 : 1);
						_this.ErrAlert = _this.ErrAlert
						uni.showToast({
							title: _this.ErrAlert,
							icon: 'none',
							duration: 2000
						});
					}

				})
			},

			// 获取限时抢购时间
			gettime() {
				var dataPrarm = 'service=shop&action=getConfigtime&gettype=1';
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						// console.log(data.info)
						var list = data.info;
						var nextHour = data.info.nextHour;
						var times;
						var currList = list[0];
						for (var i = 0; i < list.length; i++) {
							if (list[i].hongdongCount > 0) {
								currList = list[i];
								break;
							}
						}
						var now = currList.now;
						times = currList.etimestr;
						nextHour = currList.changci;
						if (now >= currList.ktimestr && now <= currList.etimestr) {
							_this.getQianggou(nextHour);
							qianggou_interval = setInterval(function() {
								_this.timeStr = _this.cutDownTime(times)
							}, 1000);
						}
					}
				})
			},

			// 准点抢购
			getQianggou(changci) {
				var dataPrarm =
					'service=shop&action=proHuodongList&huodongstate=1&huodongtype=1&pagetype=' + app.globalData.appConfig
					.shop_pagetype + '&changci=' + changci + '&pageSize=10';
				var urlData = app.encodeUrl(dataPrarm);
				_this.$ajax.post({
					url: 'include/ajax.php?' + urlData,
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						var list = data.info.list;
						var deadshop = [];
						for (var i = 0; i < list.length; i++) {
							var limitText = list[i].limitcount ? '限购' + list[i].limitcount : '';
							var price = parseFloat(Number(list[i]['huodongprice']).toFixed(2)).toString();
							deadshop[i] = {
								url: list[i].url,
								litpic: app.changeFileSize(list[i].litpic, 240, 240),
								price_int: price.split('.')[0],
								price_float: price.split('.').length > 1 ? '.' + price.split('.')[1] : '',
								title: list[i].title,
								mprice: parseFloat(list[i].mprice),
								huodonginverstory: list[i].huodonginventory,
								limitText: limitText
							};
						}
						var listArr = [];
						for (i = 0, len = deadshop.length, void 0; i < len; i += 2) {
							var i;
							var len;
							listArr.push(deadshop.slice(i, i + 2));
						}
						_this.deadshop = listArr
					}
				})
			},

			// 倒计时
			cutDownTime(datatime) {
				var eday = 3;
				var jsTime = parseInt(new Date().valueOf() / 1000);
				var timeOffset = 0;
				var end = datatime * 1000; //点击的结束抢购时间的毫秒数
				var newTime = Date.parse(new Date()) - timeOffset; //当前时间的毫秒数
				var youtime = end - newTime; //还有多久时间结束的毫秒数
				var timeArr = [];
				if (youtime <= 0) {
					timeArr = ['00', '00', '00', '00'];
					return timeArr;
				}
				var seconds = youtime / 1000; //秒
				var minutes = Math.floor(seconds / 60); //分
				var hours = Math.floor(minutes / 60); //小时
				var days = Math.floor(hours / 24); //天

				var CDay = days;
				var CHour = hours % 24;
				if (CDay <= eday) {
					//3天之内的只要小时 不要天
					CHour = CHour + CDay * 24;
					CDay = 0;
				}
				var CMinute = minutes % 60;
				var CSecond = Math.floor(seconds % 60); //"%"是取余运算，可以理解为60进一后取余数
				var c = new Date(Date.parse(new Date()));
				var millseconds = c.getMilliseconds();
				var Cmillseconds = Math.floor(millseconds % 100);
				if (CSecond < 10) {
					//如果秒数为单数，则前面补零
					CSecond = '0' + CSecond;
				}
				if (CMinute < 10) {
					//如果分钟数为单数，则前面补零
					CMinute = '0' + CMinute;
				}
				if (CHour < 10) {
					//如果小时数为单数，则前面补零
					CHour = '0' + CHour;
				}
				if (CDay < 10) {
					//如果天数为单数，则前面补零
					CDay = '0' + CDay;
				}
				if (Cmillseconds < 10) {
					//如果毫秒数为单数，则前面补零
					Cmillseconds = '0' + Cmillseconds;
				}
				if (CDay > 0) {
					timeArr = [CDay, CHour, CMinute, CSecond];
					return timeArr;
				} else {
					timeArr = ['00', CHour, CMinute, CSecond];
					return timeArr;
				}
			},

			// 获取info配置
			getInfoConfig() {
				_this.$ajax.post({
					url: 'include/ajax.php?' + app.encodeUrl('service=info&action=config'),
				}).then(res => {
					var data = res.data;
					if (data.state == 100) {
						_this.shareTitle = data.info.title
						_this.sharePic = data.info.sharePic
					}
					app.globalData.infoConfig = data.info;
				})
			},

			previewFn(index, currIndex) { //预览视频/图片
				this.staticSrc = []; //重置
				this.currentIndex = currIndex + 1
				let item = this.infoList[index];
				let video = item.video; //字符串
				let img = item.picArrs; //数组
				if (img) {
					for (let i = 0; i < img.length; i++) {
						this.staticSrc[i] = {
							type: 'image',
							value: img[i].litpic
						};
					}
				}
				if (video) {
					this.staticSrc.unshift({
						type: 'video',
						value: video
					});
				}
				this.previewb = true;
			},
			// 展开/收起
			openContent(e) {
				var type = e.currentTarget.dataset.type;
				var index = e.currentTarget.dataset.index;
				var top = e.currentTarget.dataset.currscrolltop ? e.currentTarget.dataset.currscrolltop : 0;
				// currScrollTop
				_this.infoList[index].open = type == 1 ? true : false;
				if (type == '1') {
					// 获取头部高度，
					const query = uni.createSelectorQuery();
					query.select('.fixedTop').boundingClientRect();
					query.selectViewport().scrollOffset();
					query.select('.li_' + index).boundingClientRect();
					query.exec(function(res) {
						_this.infoList[index].currScrollTop = res[1].scrollTop + res[2].top - (
							res[0] ? res[0].height : 0);
					});
				} else {
					uni.pageScrollTo({
						scrollTop: top,
						selector: '.li_' + index,
						duration: 300
					});
				}
			},

			catchTouchMove() {
				console.log('占位：函数 catchTouchMove 未声明');
			},

			clickPrivateNumber() {
				console.log('占位：函数 clickPrivateNumber 未声明');
			},
			checkIndexOf(arr, txt) {
				var includsIf = false
				if (arr.indexOf(txt) > -1) {
					includsIf = true
				}

				return includsIf
			},
			checkPop(arr) {
				var hasPop = false;
				var popInfo = ''
				if (arr && arr.length > 0) {
					for (var i = 0; i < arr.length; i++) {
						if (arr[i].search && arr[i].options && arr[i].options.length) {
							hasPop = true;
							popInfo = arr[i]
							break;
						}
					}
				}
				return popInfo
			},
			// 监听获取设备信息
			checkiOSMini() {
				const _this = this;
				let hasData = null
				_this.iosMiniHide = app.globalData.iOSMiniPay_forbid; //ios端需要隐藏支付
				if (!app.globalData.appConfig) { //未获取到appConfig
					app.essentialData(function(data) {
						_this.iosMiniHide = data.iOSMiniPay_forbid; //禁止
					})
				}
			},

			// 显示弹窗
			showiOSPayMsg() {
				const _this = this;
				uni.showModal({
					title: '温馨提示',
					content: app.globalData.iosMiniPay_msg,
					showCancel: false, //隐藏取消按钮
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						}
					},

				})
			},
		}
	};
</script>
<style>
	@import './index.css';
	@import '@/components/privatenumber/privatenumber.css';
</style>